﻿<%@ Page Language="C#" MasterPageFile="~/FrameMasterPage.master" AutoEventWireup="true" CodeFile="workOrderAddAdmin.aspx.cs" Inherits="workOrderAddAdmin" Title="Untitled Page" %>

<%@ Register Assembly="EclipseWebSolutions.DatePicker" Namespace="EclipseWebSolutions.DatePicker"
    TagPrefix="ews" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="m_contentBody" Runat="Server">

    <asp:Panel runat="server" ID="pnlBody">
   <table width="80%"><tr><td align="center">
    <table width="80%" border="0" cellpadding="0" cellspacing="0" >
       
       
        <tr>
            <td valign="top" style="width:10px"  >
             <table border="0" cellspacing="0" cellpadding="0" style="width: 330px;margin-right:5px">
                    <tr>
                        <td>
                            <img src="images/pnlTitle1Left.png" alt="" width="6" height="24"/></td>
                        <td style="width:328px" class="txtHeader">
                            Work order request</td>
                        <td align="right">
                            <img src="images/pnlTitle1Right.png" alt="" width="6" height="24"/></td>
                    </tr>
                </table>
                
            <table  border="0" cellpadding="0" cellspacing="0" 
                    style="height: 300px; width: 330px; margin-right:5px" >
                    <tr valign="top" > 
                        <td style="width:45%; height: 5px;" class="Description" align="left">
                            Department
                            <asp:Label ID="Label2" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="height: 19px;" align="left">
                            <asp:DropDownList ID="drlDepartment" runat="server" AutoPostBack="True" 
                Height="25px" Width="180px" AppendDataBoundItems="True" 
                DataSourceID="odsDepartment" DataTextField="DepartmentLabel" 
                DataValueField="DepartmentId">
                <asp:ListItem Value="-1">--- Department ---</asp:ListItem>
            </asp:DropDownList>
           
                            
                            <asp:Label ID="lblRequiredDepartment" runat="server" ForeColor="Red"></asp:Label>
                            <asp:ObjectDataSource ID="odsDepartment" runat="server" 
                    SelectMethod="GetDepartments" TypeName="Service.ReferenceDataService">
                </asp:ObjectDataSource>
                           
                            
                            </td>
                    </tr>
                    <tr valign="top">
                    
                        <td style="width:30%; height: 5px;" class="Description" colspan="0" 
                            align="left">
                            Requester name
                            <asp:Label ID="Label1" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                      
                        <td style="height: 28px;" align="left">
                            <asp:DropDownList ID="drlRequester" runat="server" Height="25px" 
                Width="180px" DataSourceID="odsRequester" 
                DataTextField="EmployeeName" DataValueField="EmployeeId">
            </asp:DropDownList>
                            <asp:Label ID="lblRequiredRequestName" runat="server" ForeColor="Red"></asp:Label>
                            <asp:ObjectDataSource ID="odsRequester" runat="server" 
                    SelectMethod="GetRequestEmployees" TypeName="Service.ReferenceDataService">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="drlDepartment" Name="departmentId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                            
                        </td>
                    </tr>
                    <tr>
                        <td class="Description" style="width:30%; height: 5px;" colspan="0" 
                            align="left">
                            Request type
                            <asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="height: 28px;" align="left">
                            <asp:DropDownList ID="drlRequestType" runat="server" 
                                DataSourceID="odsRequestType" Height="25px" Width="180px" 
                                DataTextField="RequestTypeLabel" DataValueField="RequestTypeId" 
                                AppendDataBoundItems="True">
                                <asp:ListItem Value="-1">--- Choose request type ---</asp:ListItem>
                               </asp:DropDownList>
                            <asp:Label ID="lblRequiredRequestType" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:30%; " class="Description" colspan="0" align="left">
                            Criteria&nbsp;
                            <asp:Label ID="Label4" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="drlCriteria" runat="server" AppendDataBoundItems="True" 
                                DataSourceID="odsCriteria" DataTextField="CriteriaLabel" 
                                DataValueField="CriteriaId" Height="25px" Width="180px">
                                <asp:ListItem Value="-1">--- Choose a criteria ---</asp:ListItem>
                            </asp:DropDownList>
                            <br>
                            
                            
                            <asp:Label ID="lblRequiredCriteria" runat="server" ForeColor="Red"></asp:Label>
                                               
                            
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:30%; height: 5px;" class="Description" colspan="0" 
                            rowspan="1" align="left">
                            Requested date(dd/mm/yyyy)
                            <asp:Label ID="Label5" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="height: 19px;" align="left">
                           
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtRequestDate" runat="server" Width="150px"></asp:TextBox>
            <asp:Image ID="imgCalendar" runat="server" ImageUrl="~/images/calendar.png" />
            <cc1:CalendarExtender ID="CalendarExtender5" runat="server" TargetControlID="txtRequestDate" PopupButtonID="imgCalendar">
            </cc1:CalendarExtender> 
                                    <asp:Label ID="lblRequiredRequestDate" runat="server" ForeColor="Red"></asp:Label>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                           
                        </td>
                            
                    </tr>
                    <tr>
                        <td class="Description" style="width:30%; height: 5px;" colspan="0" 
                            align="left">
                            Required date(dd/mm/yyyy)
                            <asp:Label ID="Label6" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="height: 49px;" align="left">
                            <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtRequiredDate" runat="server" Width="150px"></asp:TextBox>
            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/calendar.png" />
            <cc1:CalendarExtender ID="CalendarExtender4" runat="server" TargetControlID="txtRequiredDate" PopupButtonID="Image1">
            </cc1:CalendarExtender> 
                                    <asp:Label ID="lblRequiredDate" runat="server" ForeColor="Red"></asp:Label>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td class="Description" style="width:30%; height: 5px;" colspan="0" 
                            align="left">
                            Agree date(dd/mm/yyyy)
                            <asp:Label ID="Label11" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="height: 49px;" align="left">
                            <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                     <asp:TextBox ID="txtAgreeDate" runat="server" Width="150px"></asp:TextBox>
            <asp:Image ID="Image2" runat="server" ImageUrl="~/images/calendar.png" />
            <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtAgreeDate" PopupButtonID="Image2">
            </cc1:CalendarExtender> 
                                    <asp:Label ID="lblAgreeDate" runat="server" ForeColor="Red"></asp:Label>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr valign="top">
                        <td class="Description" style="width:30%; height: 5px;" colspan="0" 
                            align="left">
                            Request time(hh:mm)<asp:Label ID="Label9" runat="server" ForeColor="Red" 
                                Text="*"></asp:Label>
                        </td>
                        <td style="height: 6px;" align="left">
                            <asp:TextBox ID="txtRequestTime" runat="server" MaxLength="20" Width="150"></asp:TextBox>
                            <asp:Label ID="lblRequiredRequestTime" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                    </tr>
                </table>
            
            </td> 
            <td valign="top" style="width:auto ">
                
     
               
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <img src="images/pnlTitle1Left.png" alt="" width="6" height="24"/></td>
                        <td style="width:100%" class="txtHeader">
                            Planning (Optional)</td>
                        <td align="right">
                            <img src="images/pnlTitle1Right.png" alt="" width="6" height="24"/></td>
                    </tr>
                </table>
                <table width="100%" border="0" cellpadding="0" cellspacing="0"
                 style="height: 130px; width: 350px;">
                    <tr valign="top" style="width:550px">
                        <td style="width:555px" class="Description" colspan="0" align="left">
                            Plan date(mm/dd/yy)</td>
                        <td style="width:90%" align="left">
                            
                            <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtPlanDate" runat="server" Width="150px"></asp:TextBox>
            <asp:Image ID="Image3" runat="server" ImageUrl="~/images/calendar.png" />
            <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtPlanDate" PopupButtonID="Image3">
            </cc1:CalendarExtender>
            
                                </ContentTemplate>
                            </asp:UpdatePanel>
                            
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:100%" class="Description" align="left">
                            Plan time (hh:mm)</td>
                        <td style="width:70%" align="left">
                            <asp:TextBox runat="server" ID="txtPlanTime" Width="170" MaxLength="40"></asp:TextBox>
                            
                            <asp:Label ID="lblRequiredPlanTime" runat="server" ForeColor="Red"></asp:Label>
                            
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:50%" class="Description" colspan="0" align="left">
                            Estimate time (in minutes)</td>
                        <td style="width:70%" align="left">
                           
                            <asp:TextBox ID="txtEstimatedTime" runat="server" MaxLength="20" 
                                Width="170"></asp:TextBox>
                           
                        </td>
                            
                    </tr>
                    <tr valign="top">
                        <td class="Description" style="width:30%" colspan="0">
                            Priority</td>
                        <td style="width:70%" align="left">
                            <asp:DropDownList ID="drlPriority" runat="server" 
                                Height="25px" Width="100px">
                                <asp:ListItem>1</asp:ListItem>
                                <asp:ListItem>2</asp:ListItem>
                                <asp:ListItem>3</asp:ListItem>
                                <asp:ListItem>4</asp:ListItem>
                                <asp:ListItem>5</asp:ListItem>
                                <asp:ListItem>6</asp:ListItem>
                                <asp:ListItem>7</asp:ListItem>
                                <asp:ListItem>8</asp:ListItem>
                                <asp:ListItem>9</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr valign="top">
                        <td class="Description" style="width:30%; height: 20px;" colspan="0" 
                            align="left">
                            Remark</td>
                        <td style="width:50%; height: 26px;" align="left">
                            <asp:TextBox ID="txtRemark" runat="server" Height="20px" Width="170px" 
                                TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            
                <asp:ObjectDataSource ID="odsITemployee" runat="server" 
                    SelectMethod="GetAssignedEmployees" TypeName="Service.ReferenceDataService">
                </asp:ObjectDataSource>
                <asp:ObjectDataSource ID="odsRequestType" runat="server" 
                    SelectMethod="GetRequestTypes" TypeName="Service.WorkOrderService">
                </asp:ObjectDataSource>
                <br />
                <asp:ObjectDataSource ID="odsCriteria" runat="server" 
                    SelectMethod="GetCriterias" TypeName="Service.WorkOrderService">
                </asp:ObjectDataSource>
                <cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
                    ConfirmText="Are you sure to add this work order?" 
                    TargetControlID="btnValidateWorkOrder">
                </cc1:ConfirmButtonExtender>
     
    
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <img src="images/pnlTitle1Left.png" alt="" width="6" height="24"/></td>
                        <td style="width:100%" class="txtHeader">
                            Problem&nbsp;</td>
                        <td align="right">
                            <img src="images/pnlTitle1Right.png" alt="" width="6" height="24"/></td>
                    </tr>
                </table>
                <table width="100%" border="0" cellpadding="0" cellspacing="0"
                   style="height: 130px; width: 350px;">
                    <tr valign="top">
                        <td style="width:550px; height: 5px;" class="Description" colspan="0" 
                            align="left">
                            Owner
                            <asp:Label ID="Label12" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="width:70%; height: 5px;" align="left">
                            <asp:DropDownList ID="drlEquipmentOwner" runat="server" Height="20px" 
                Width="180px" DataSourceID="odsOwner" 
                DataTextField="EmployeeName" DataValueField="EmployeeId">
            </asp:DropDownList>
                            <asp:ObjectDataSource ID="odsOwner" runat="server" SelectMethod="GetEmployees" 
                                TypeName="Service.ReferenceDataService"></asp:ObjectDataSource>
                            <asp:Label ID="lblRequiredOwner" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr valign="top">
                        <td class="Description" style="width:80%" align="left">
                            Equipment ID<asp:Label ID="Label8" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="width:70%" align="left">
                       
                            <asp:TextBox ID="txtEquipCodeNumber" runat="server" AutoPostBack="True" 
                                Height="17px" ontextchanged="txtEquipCodeNumber_TextChanged" Width="140px"></asp:TextBox>
                            <asp:ImageButton ID="ImgCodeInformation" runat="server" Height="20px" 
                                ImageUrl="~/images/info.png" onclick="ImgCodeInformation_Click" Width="28px" />
                            <asp:Label ID="lblRequiredCodeNumber" runat="server" ForeColor="Red"></asp:Label>
                            
                            <br />
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:80%" class="Description" align="left">
                            Problem Group<asp:Label ID="Label7" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="width:70%" align="left">
                            
                            <asp:DropDownList ID="drlProblem" runat="server" 
                                Height="22px" Width="180px" 
                                onselectedindexchanged="drlProblem_SelectedIndexChanged">
                            </asp:DropDownList>
                            <asp:Label ID="lblRequiredProblemGroup" runat="server" ForeColor="Red"></asp:Label>
                            
                        </td>
                    </tr>
                    <tr valign="top">
                        <td style="width:80%" class="Description" align="left">
                            Problem<asp:Label ID="Label10" runat="server" ForeColor="Red" Text="*"></asp:Label>
                        </td>
                        <td style="width:70%" align="left">
                            <asp:TextBox ID="txtNewProblem" runat="server" Height="20px" Width="175px" 
                                TextMode="MultiLine"></asp:TextBox>
                            <asp:Label ID="lblRequiredProblem" runat="server" ForeColor="Red"></asp:Label>
                            
                        </td>
                    </tr>
                    <tr>
                        <td class="Description" style="width:80%" align="left">
                            Employee to be assigned</td>
                        <td style="width:70%" align="left">
                            <asp:DropDownList ID="drlITStaff" runat="server" DataSourceID="odsITemployee" 
                                DataTextField="EmployeeName" DataValueField="EmployeeId" Height="25px" 
                                Width="155px">
                            </asp:DropDownList>
                            <asp:ImageButton ID="imgButtonLabor" runat="server" Height="16px" 
                                ImageUrl="~/images/calendar.png" onclick="imgButton_Click" Width="16px" />
                        </td>
                    </tr>
                    <tr>
                        <td class="Description" style="width:80%" align="left">
                            &nbsp;</td>
                        <td style="width:70%" align="left">
                            <asp:Button ID="btnValidateWorkOrder" runat="server" BorderStyle="Dotted" 
                                CssClass="btnexpress" Height="20px" onclick="btnValidateWorkOrder_Click" 
                                Text="Validate" Width="71px" />
                            <asp:Button ID="btnCancelWorkOrder" runat="server" BorderStyle="Dotted" 
                                CssClass="btnexpress" Height="20px" onclick="btnCancelWorkOrder_Click" 
                                Text="Cancel" Width="71px" />
                            <asp:Label ID="lblPermission" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        
                        <td style="width:70%" colspan="2">
                        <asp:Label ID="lblMessageValidate" runat="server" CssClass="permissionstyle"></asp:Label>
                        
                            <asp:Label ID="lblInformation" runat="server" CssClass="permissionstyle"></asp:Label>
                            <asp:TextBox ID="txtHiddenCodeNumber" runat="server" Height="17px" 
                                Visible="False" Width="175px"></asp:TextBox>
                            &nbsp;<asp:TextBox ID="txtHiddenWorkOrderId" runat="server" Enabled="False" 
                                Height="17px" Visible="False" Width="175px"></asp:TextBox>
                        </td>
                    </tr>
                </table>     
    </td>
   
    
    
    </tr>
       
</table>
</td></tr></table>
   </asp:Panel>
</asp:Content>
